//
//  XLTaskTableViewCell.m
//  XiangLove
//
//  Created by feng song on 2018/3/29.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLTaskTableViewCell.h"

@implementation XLTaskTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        self.contentView.backgroundColor = kWhiteColor;
        [self setupView];
    }
    return self;
}

-(void)setupView
{
    //任务名
    _everyTaskLab = [[UILabel alloc] init];
    _everyTaskLab.font = [UIFont systemFontOfSize:17];
    _everyTaskLab.textColor = RGB_HEX(0x000000);
    [self.contentView addSubview:_everyTaskLab];
    [_everyTaskLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.top.equalTo(self.contentView.mas_top).offset(20);
    }];
    
    //进程
    _progressIdLab = [[UILabel alloc] init];
    _progressIdLab.font = [UIFont systemFontOfSize:12];
    _progressIdLab.textColor = RGB_HEX(0x9395A2);
    [self.contentView addSubview:_progressIdLab];
    [_progressIdLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.everyTaskLab.mas_right).offset(4);
        //make.top.equalTo(self.contentView.mas_top).offset(20);
        make.centerY.equalTo(self.everyTaskLab.mas_centerY);
    }];
    
    //描述
    _taskDescriptionLab = [[UILabel alloc] init];
    _taskDescriptionLab.font = [UIFont systemFontOfSize:12];
    _taskDescriptionLab.textColor = RGB_HEX(0x9395A2);
    _taskDescriptionLab.numberOfLines = 2;
    [self.contentView addSubview:_taskDescriptionLab];
    [_taskDescriptionLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.top.equalTo(self.everyTaskLab.mas_bottom).offset(6);
        make.right.equalTo(self.contentView.mas_right).offset(-100);
    }];
    
    //金豆
    _jdLab = [[UILabel alloc] init];
    _jdLab.font = [UIFont systemFontOfSize:12];
    _jdLab.textColor = RGB_HEX(0x9395A2);
    [self.contentView addSubview:_jdLab];
    [_jdLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-12);
    }];
    
    //积分
    _integralLab = [[UILabel alloc] init];
    _integralLab.font = [UIFont systemFontOfSize:12];
    _integralLab.textColor = RGB_HEX(0x9395A2);
    [self.contentView addSubview:_integralLab];
    [_integralLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jdLab.mas_right).offset(15);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-12);
    }];
    
    _taskTypeBtn = [[UIButton alloc] init];
    _taskTypeBtn.titleLabel.font = kSetFont(14.0);
    [self.contentView addSubview:_taskTypeBtn];
    [_taskTypeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-15);
        make.centerY.equalTo(self.contentView);
        make.size.mas_equalTo(CGSizeMake(70, 32));

    }];
    
    
}

@end
